package com.itheima.mapper;

import com.itheima.pojo.Dish;
import com.itheima.pojo.Flavor;
import com.itheima.vo.DishVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DishMapper {



    Integer save(Dish dish);

    Integer update(DishVo dishVO);

    List<Dish> page(@Param("name")String name,@Param("start") Integer start,@Param("pageSize") Integer pageSize,@Param("type") Integer type);

   List<Dish> getList(@Param("categoryId") String categoryId);


    Integer delete(@Param("ids") List<String> ids);

    int insertFlavor(@Param("Flauor") Flavor flavor);

    int batchInsertFlavor(@Param("list") List<Flavor> list);

    int countFlavorByDishId(@Param("id") String id);

    int removeFlavorByDishId(@Param("id")String id);

    DishVo getById(@Param("id")String id);

    int sell(@Param("ids") List<String> ids ,@Param("status")int status);

    List<Flavor> getFlavorById(@Param("id") String id);

    List<Flavor> getFlavorByDishId(String dishId);

    long count();


    List<Dish> clientGetList(@Param("categoryId") String categoryId , @Param("status") Integer status,
                             @Param(("start")) Integer start,@Param("pageSize") Integer pageSize);
}
